#ifndef INCLUDE__TABLE_H
#define INCLUDE__TABLE_H

typedef struct table_s *table_t;

/* make a new table */
table_t tab_empty(void);

/* enter key->value into table tab, shadowing any previous binding for key */
void tab_enter(table_t tab, void *key, void *value);

/* lookup key in table tab */
void *tab_lookup(table_t tab, void *key);

/* pop the most recent binding and return its key */
/* this may expose another binding for the same key */
void *tab_pop(table_t tab);

typedef void (*tab_dump_func_t)(void *key, void *value);
/* using show function to display all the (key, value) elements in the table */
void tab_dump(table_t tab, tab_dump_func_t show);

#endif
